<%= render 'order_actions', order: @order, events: @order_events %>

<%= render 'spree/admin/shared/order_tabs', current: :shipments %>

<% content_for :page_title do %>
  / <%= plural_resource_name(Spree::Shipment) %>
<% end %>

<div data-hook="admin_order_edit_header">
  <%= render 'spree/admin/shared/error_messages', target: @order %>
</div>

<% if @order.payments.valid.any? && @order.considered_risky? %>
  <%= render 'spree/admin/orders/risk_analysis', latest_payment: @order.payments.valid.last %>
<% end %>

<%= render 'add_product' if @order.shipment_state != 'shipped' && can?(:update, @order) %>

<% if @order.line_items.empty? %>
  <div class="alert alert-warning">
    <%= Spree.t(:your_order_is_empty_add_product)%>
  </div>
<% end %>

<div data-hook="admin_order_edit_form">
  <div id="order-form-wrapper">
    <%= render partial: 'form', locals: { order: @order } %>
  </div>
</div>

<%= render 'spree/admin/shared/order_summary' %>
